package org.myspringframework.test.postprocessor;

import org.myspringframework.beans.BeansException;
import org.myspringframework.beans.factory.config.postprocessor.BeanPostProcessor;
import org.myspringframework.context.annotation.Component;

@Component
public class MyBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("--------"+bean+"准备进行初始化 ---------");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("--------"+bean+"初始化完成-------");
        return null;
    }
}
